<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>



<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="/designinclass/css/formain.css" rel="stylesheet"
	type="text/css" />
<script src="/designinclass/js/formain.js" type="text/javascript"></script>

<script type="text/javascript">
function acc(){
	var a;
	a="${temp}";
	if(a>0){alert("请先登录");}}

	

</script>

</head>
<body  onload="acc()">

	<div id="index">

		<div id="top">

			<ul>

				<li onclick="log()"><c:if test="${empty username}" var="young"
						scope="session">登录</c:if></li>
				<li><a href="/designinclass/IniServlet">返回贴吧</a></li>
				<li><c:if test="${!empty username}" var="young1"
						scope="session">欢迎您:${username}</c:if></li>


				
			</ul>
		</div>
		<div id="middle">
			<div id="left"></div>
			<div id="center">
				<c:set var="count" value="1" scope="request"></c:set>
				<c:forEach items="${lz}" var="g">



					<div class="building">
						<a href="/designinclass/CommentServlet">标题：${g.title}-----内容：${g.content}-------发布者：${g.owner}</a>
					</div>




				</c:forEach>
				<c:forEach items="${titles}" var="t">



					<c:if test="${count%2>0}">
						<div class="buildings">
							<div>${t.tag}评论道：${t.content}</div>
							<div>
								<a href="/designinclass/ReplyServlet?commentid=${t.id}">查看回复</a>
							</div>

							<div>
								<c:if test="${t.id==commentid}">
									<c:forEach items="${replys}" var="v">


										<div>${v.source}---回复---${v.content}</div>

									</c:forEach>
									<div>
										<form method="post" action="/designinclass/SentReplyServlet">

											<div>

												<textarea name="content"></textarea>
											</div>
											<input type="hidden" name="commentid" value="${t.id}" />
											<div>
												<input type="submit" value="回复" />
											</div>

										</form>
									</div>
								</c:if>
							</div>
						</div>
					</c:if>

					<c:if test="${count%2<1}">
						<div class="building">
							<div>${t.tag}评论道：${t.content}</div>
							<div>
								<a href="/designinclass/ReplyServlet?commentid=${t.id}">查看回复</a>
							</div>

							<div>
								<c:if test="${t.id==commentid}">
									<c:forEach items="${replys}" var="v">


										<div>${v.source}---回复---${v.content}</div>

									</c:forEach>
									<div>
										<form method="post" action="/designinclass/SentReplyServlet">

											<div>

												<textarea name="content"></textarea>
											</div>
											<input type="hidden" name="commentid" value="${t.id}" />
											<div>
												<input type="submit" value="回复" />
											</div>

										</form>
									</div>
								</c:if>
							</div>
						</div>
					</c:if>
					<c:set var="count" value="${count+1}"></c:set>



				</c:forEach>
				<div>
					<form method="post" action="/designinclass/SentCommentServlet">

						<div>
							评论：
							<textarea name="content"></textarea>
						</div>
						<input type="hidden" name="buildingid" value="${buildingid}" />
						<div>
							<input type="submit" value="发表" />
						</div>

					</form>
				</div>

			</div>
			<div id="right"></div>


		</div>
		<div id="bottom"></div>
	</div>

	<div id="dialogue" style="position: absolute; left: 500px; top: 160px"
		onmousedown="$(this,event)">
		<form action="/designinclass/LogInServlet" method="post">
			<h1>
				<font color="blue">登录</font>
			</h1>
			<br>
			<hr />
			<div>
				<div class="hint">用户名</div>
				<div>
					<input type="text" name="username" />
				</div>
				<br>
				<div class="hint">密码</div>
				<div>
					<input type="password" name="password" />
				</div>
				<br>

				<div class="hint">验证码</div>
				<div>
					<input type="text" name="checkcode" />
				</div>
				<br>

				<div class="hint">
					<input type="hidden" />
				</div>
				<br>

				<div>
					<input type="submit" value="确定" />
				</div>
				<div>
					<a href="/designinclass/CommentServlet"><input type="button"
						value="取消" /></a>
				</div>


			</div>

		</form>


	</div>

	<div id="light"></div>



</body>
</html>